package ma.co.ba.BusinessApplications.dao.commons;

import java.util.List;

public interface DAOServices {
	
	
	// CRUD OPERATIONS (Create, Read, Update, Delete Operations)
	public Integer saveEntity(Object entity);

	public void deleteEntity(Object entity);

	public void mergeEntity(Object entity);

	public void updateEntity(Object entity);

	public <T> T getEntityById(Class<T> type, Integer id);

	public <T> Object getEntityById2(Class<T> type, Integer id);

	public <T> T getEntityByCode(Class<T> type, String code);

	public <T> List<T> searchByProperty(Class<T> type, String propertyName,
			Object propertyValue);
	
	//OPERATIONS ON SEVERALS ENTITIES
	public <T> List<T> getEntitiesByProperty(Class<T> type,
			String propertyName, Object value);

	public <T> Object  getUniqueEntitiyByProperty(Class<T> type,
			String propertyName, Object value);
	
	public void saveEntities(List<?> entities);

	public <T> List<T> getEntities(Class<T> type);


}
